#include <iostream>
#include <cmath>

using namespace std;

class Rectangle
{
	private:
		double left, top;
		double right, bottom;

	public:
		Rectangle(double l=0, double t=0, double r=0, double b=0);
		~Rectangle()
		{}
		void Assign(double l, double t, double r, double b);
		void Show();
		double Area();
		double Perimeter();
};

Rectangle::Rectangle(double l, double t, double r, double b)
{
	left = l;
	top = t;
	right = r;
	bottom = b;
}

void Rectangle::Assign(double l, double t, double r, double b)
{
	left = l;
	top = t;
	right = r;
	bottom = b;
}

void Rectangle::Show()
{
	cout << "left-top point is (" << left << "," << top << ")" << '\n';
	cout << "right-bottom point is (" << right << "," << bottom << ")" << '\n';
}

double Rectangle::Area()
{
	return fabs((right - left) * (bottom - top));
}

double Rectangle::Perimeter()
{
	return 2 * (fabs(right - left) + fabs(bottom - top));
}

int main()
{
	cout << min(0, 1);
	Rectangle rect;
	rect.Show();
	rect.Assign(100, 200, 300, 400);
	rect.Show();

	Rectangle rect1(0, 0, 200, 200);
	rect1.Show();
	rect1.Assign(100, 200, 300, 400);
	rect.Show();
	cout << "面积" << rect.Area() << '\t' << "周长" << rect.Perimeter() << endl;
	cout << "面积" << rect1.Area() << '\t' << "周长" << rect1.Perimeter() << endl;

	return 0;
}
